-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PyTorch] Userbuffers support in operation-based API #1142
Conversation
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Assumes FP8 RS, which is not a good assumption. Signed-off-by: Tim Moon <[email protected]>
Bias pointers are not properly offset for different data chunks. Also removed logic for FP8 RS. Signed-off-by: Tim Moon <[email protected]>
Test passes with row TP, fails with col TP. Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
for more information, see https://pre-commit.ci
Signed-off-by: Tim Moon <[email protected]>
/te-ci pytorch |
/te-ci pytorch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, at least on the Userbuffers code side.
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
for more information, see https://pre-commit.ci
Signed-off-by: Tim Moon <[email protected]>
/te-ci pytorch |
Signed-off-by: Tim Moon <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous UB GEMM+RS impl has a correctness bug. UB splits up the GEMM into multiple chunks so that it can do the GEMM to compute one output chunk at the same time it is doing an RS on another output chunk. However, each output chunk requires applying a different chunk of the bias. We previously used the same bias pointer for all chunks, while this PR computes the correct offsets in the bias pointer.
data: Optional[torch.Tensor] = None, | ||
scale: Optional[torch.Tensor] = None, | ||
amax: Optional[torch.Tensor] = None, | ||
scale_inv: Optional[torch.Tensor] = None, | ||
with_transpose_cache: bool = False, | ||
data_transpose: Optional[torch.Tensor] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The
data
kwarg allows us to easily initializeFloat8Tensor
s that use the UB workspace buffer - The
data_transpose
kwarg is added for completeness
/te-ci pytorch |
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
Signed-off-by: Tim Moon <[email protected]>
for more information, see https://pre-commit.ci
/te-ci L1 |
/te-ci pytorch jax paddle L1 |
Signed-off-by: Tim Moon <[email protected]>
/te-ci pytorch L1 |
Description
This PR adds basic support in the linear operation for using Userbuffers to overlap tensor-parallel communication with GEMMs. This is implemented as fused operations:
I've tried to avoid touching the core UB infrastructure in
transformer_engine/pytorch/module/base.py
, so I've kept the messy API and hackily worked around some bugs. This feature should be considered experimental and unstable.Type of change
Changes
Checklist: